package com.itheima_03;

import java.util.Scanner;
/*
    键盘录入5个整数，存入数组中，并求和
*/
public class GetSum {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int [] arr = new int [5];
        int sum = arr[0];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第" + (i+1) + "个整数：");
            arr [i] = sc.nextInt();
            sum += arr[i];
        }
        System.out.println("sum:" + sum);
    }
}
